FROM python:3.8
ENV PYTHONUNBUFFERED 1
RUN sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
RUN sed -i 's/security.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
RUN echo 'deb http://www.deb-multimedia.org jessie main' >> /etc/apt/sources.list
RUN mkdir /code && mkdir -p ~/.ssh
WORKDIR /code
COPY . /code/
# RUN cp deploy/gitlab/build_key ~/.ssh && chmod 700 ~/.ssh/build_key
RUN apt update | true  && apt -y --force-yes install supervisor openssh-server openssh-client rsync 
RUN echo "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
RUN pip install --upgrade pip -i https://pypi.douban.com/simple
RUN echo "export GIT_SSL_NO_VERIFY=1" >> ~/.bashrc && export GIT_SSL_NO_VERIFY=1
# RUN eval $(ssh-agent -s) && ssh-add ~/.ssh/build_key 
RUN pip install -r requirement.txt -i https://pypi.douban.com/simple 
RUN python manage.py makemigrations
RUN rm main -rf